<% content_for(:title, admin.t("titles.index", default: "Listing %{pluralized_model_name}")) %>

<% toolbar(:primary) do |t| %>
  <%= t.new %>
  <%= hook("index.toolbar.primary", t) %>
<% end %>

<% toolbar(:secondary) do |t| %>
  <%= hook("index.toolbar.secondary", t) %>
<% end %>

<% content_for(:utilities) do %>
  <%= render "scopes" %>
<% end if admin.scopes.any? %>

<%= render layout: "layout" do %>
  <% if hook?("resource.index.header") %>
    <header class="main-content-header">
      <%= hook("resource.index.header") %>
    </header>
  <% end %>

  <%= render "trestle/table/table", table: admin.table, collection: collection %>

  <footer class="main-content-footer">
    <%= hook("resource.index.footer") %>

    <%= pagination collection: collection, entry_name: admin.model_name %>
  </footer>
<% end %>
